#include "cpu/exec/template-start.h"

#define instr call

make_helper(concat(call_i_, SUFFIX)) {
	int len=concat(decode_i_, SUFFIX)(cpu.eip+1);   //  the len of the op         decode_i_l(cpu.eip+1) 
    reg_l(R_ESP) -= DATA_BYTE;  //ESP -> zhan zhen add towards low address
    swaddr_write(reg_l(R_ESP), 4, cpu.eip+len+1);  //address, len, data
    DATA_TYPE_S offset=op_src->val;
    print_asm("call\t%x",cpu.eip+1+len+offset);  //address now+offeset
    cpu.eip+=offset;
    return len+1;
}
#include "cpu/exec/template-end.h"

/*mov
static void do_execute() {
	OPERAND_W(op_dest, op_src->val);
	print_asm_template2();
}

make_instr_helper(i2r)
make_instr_helper(i2rm)
make_instr_helper(r2rm)
make_instr_helper(rm2r)

make_helper(concat(mov_a2moffs_, SUFFIX)) {
	swaddr_t addr = instr_fetch(eip + 1, 4);
	MEM_W(addr, REG(R_EAX));

	print_asm("mov" str(SUFFIX) " %%%s,0x%x", REG_NAME(R_EAX), addr);
	return 5;
}*/


